/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package manager;

import entity.Employee;
import java.util.ArrayList;

/**
 *
 * @author NgocNam
 */
public class managerEmployee {
     ArrayList<Employee> list;
     
    public managerEmployee() {
        list = new ArrayList<Employee>();
    }

    public void addEmployee(Employee e) {
        list.add(e);
    }

    public void addEmployee(ArrayList<Employee> list) {
        this.list.addAll(list);
    }

    public void removeEmployee(Employee e) {
        this.list.remove(e);
    }
    

    public void updateEmployee(Employee e) {
        for (int i = 0; i < this.list.size(); i++) {
            if (list.get(i).getEmployeeID() == e.getEmployeeID()) {
                list.set(i, e);
            }
        }

    }

    public Employee getEmployee(int index) {
       return  this.list.get(index);
    }

    public int getSize() {
        return list.size();
    }
}
